package com.tjetc.字节流;

import java.io.*;

public class T05缓冲字节流文件拷贝 {
    public static void main(String[] args) throws IOException {
        BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(new File("a.txt")));
        BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(new File("b.txt")));
        byte[] bytes = new byte[1024];
        int num;
        while ((num=inputStream.read(bytes))!=-1){
            outputStream.write(bytes,0,num);
        }
        outputStream.close();
        inputStream.close();
    }
}
